<!doctype html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />









  <meta name="baidu-site-verification" content="Q7ugSRSO7V" />







  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="Hexo, NexT" />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.0" />






<meta name="description" content="学习文件系统相关函数。创建文件   touch(‘文件名’);移动文件   rename(‘源路径’,’目标路径’);删除文件   unlink(‘文件路径’);重命名文件  rename(‘原文件名’,’新文件名’);复制文件   copy(‘源文件路经’,’目标文件路径’); 文件的打开和关闭。fopen(‘文件名’,’打开的方式’);   // R 只读模式打开    返回文件资源fclos">
<meta property="og:type" content="article">
<meta property="og:title" content="文件系统">
<meta property="og:url" content="http://yoursite.com/php/文件系统/index.html">
<meta property="og:site_name" content="chimps">
<meta property="og:description" content="学习文件系统相关函数。创建文件   touch(‘文件名’);移动文件   rename(‘源路径’,’目标路径’);删除文件   unlink(‘文件路径’);重命名文件  rename(‘原文件名’,’新文件名’);复制文件   copy(‘源文件路经’,’目标文件路径’); 文件的打开和关闭。fopen(‘文件名’,’打开的方式’);   // R 只读模式打开    返回文件资源fclos">
<meta property="og:updated_time" content="2017-04-23T14:41:29.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="文件系统">
<meta name="twitter:description" content="学习文件系统相关函数。创建文件   touch(‘文件名’);移动文件   rename(‘源路径’,’目标路径’);删除文件   unlink(‘文件路径’);重命名文件  rename(‘原文件名’,’新文件名’);复制文件   copy(‘源文件路经’,’目标文件路径’); 文件的打开和关闭。fopen(‘文件名’,’打开的方式’);   // R 只读模式打开    返回文件资源fclos">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    sidebar: {"position":"left","display":"hide","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":30},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/php/文件系统/"/>





  <title> 文件系统 | chimps </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  





  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?dcb994042608bdb310eff950ba755ff1";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>










  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">chimps</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/php/文件系统/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="chimps">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="https://sfault-avatar.b0.upaiyun.com/416/326/4163260007-58a1621e63a68_huge256">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="chimps">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                文件系统
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-04-23T22:40:19+08:00">
                2017-04-23
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/php/" itemprop="url" rel="index">
                    <span itemprop="name">php</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a class="cloud-tie-join-count" href="/php/文件系统/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count join-count" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          
          

          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <h1 id="学习文件系统相关函数。"><a href="#学习文件系统相关函数。" class="headerlink" title="学习文件系统相关函数。"></a>学习文件系统相关函数。</h1><figure class="highlight php"><table><tr><td class="code"><pre><div class="line">创建文件   touch(‘文件名’);</div><div class="line">移动文件   rename(‘源路径’,’目标路径’);</div><div class="line">删除文件   unlink(‘文件路径’);</div><div class="line">重命名文件  rename(‘原文件名’,’新文件名’);</div><div class="line">复制文件   copy(‘源文件路经’,’目标文件路径’);</div></pre></td></tr></table></figure>
<h1 id="文件的打开和关闭。"><a href="#文件的打开和关闭。" class="headerlink" title="文件的打开和关闭。"></a>文件的打开和关闭。</h1><figure class="highlight php"><table><tr><td class="code"><pre><div class="line">fopen(‘文件名’,’打开的方式’);   <span class="comment">// R 只读模式打开    返回文件资源</span></div><div class="line">fclose（‘用fopen打开的文件资源’）；</div><div class="line">fread(‘文件资源’，’读取的长度（字节）’) 读取文件</div><div class="line">fgetc 读取一个字符</div><div class="line">fgets 读取一行</div><div class="line">feof(‘文件资源’) 返回文件的结尾， 到结尾的时候返回<span class="keyword">true</span>. 没到结尾返回<span class="keyword">false</span>;</div><div class="line"></div><div class="line">快捷操作</div><div class="line">file_get_contents(‘文件路径’);</div><div class="line"><span class="comment">/*返回读取的内容。</span></div><div class="line">相当于：打开文件、读取文件、关闭文件。</div><div class="line">返回值：写入的字节数=Fwrite(‘文件资源’,’写入的字符串‘,’写入的长度’);</div><div class="line">*/</div><div class="line"></div><div class="line">$int= file_put_contents(‘文件路径’,’要写入的内容’);</div><div class="line"><span class="comment">/*</span></div><div class="line">返回：写入的字节长度。</div><div class="line">打开的文件模式</div><div class="line">R 只读方式打开文件</div><div class="line">R+ 读写方式打开文件（可以执行部分的写入功能）</div><div class="line">W 写入方式打开文件，如果文件不存在，则创建，如果文件存在，则清空文件后在写入。</div><div class="line">W+ 读写方式打开文件（可以执行部分的读取功能）写好事</div><div class="line">A 追加的方式打开文件。如果文件不存在则创建。</div><div class="line">A+ 追加的方式打开文件。。可以执行部分的读取功能。文件不存在则创建</div><div class="line">X 抑或方式打开文件。文件存在就报错，不存在就创建并且写入</div><div class="line">X+ 增强的抑或模式，可以执行部分的读取功能</div><div class="line">*/</div><div class="line">file_put_contents();如果将该功能改成追加的方式写入需要填写第三个参数 FILE_APPEND；</div><div class="line"></div><div class="line">filesize();     获取文件大小的函数</div><div class="line">is_file();      判断是否是文件</div><div class="line">file_exists();  判断文件或目录是否存在</div><div class="line">is_readable();  判断文件是否可读</div><div class="line">is_excutable(); 判断文件是否可执行</div><div class="line">is_writable();  判断文件是否可写</div><div class="line">filectime();    获取文件的创建时间</div><div class="line">filemtime();    获取文件的修改时间</div><div class="line">fileatime();    获取文件的上次访问时间</div></pre></td></tr></table></figure>
<h1 id="目录操作"><a href="#目录操作" class="headerlink" title="目录操作"></a>目录操作</h1><figure class="highlight php"><table><tr><td class="code"><pre><div class="line">mkdir()</div><div class="line"><span class="comment">//创建目录 </span></div><div class="line"><span class="comment">//参数1   要创建的目录</span></div><div class="line"><span class="comment">//参数2   创建的权限   最高权限  777</span></div><div class="line"><span class="comment">//参数3   true   可以嵌套创建。</span></div><div class="line">opendir()</div><div class="line"><span class="comment">//打开目录 </span></div><div class="line">readdir();</div><div class="line"><span class="comment">//读取目录 </span></div><div class="line"><span class="comment">//注意：每一个目录下都有点(.)和点点(..)</span></div><div class="line"><span class="comment">//点（.）:代表当前目录</span></div><div class="line"><span class="comment">//点点(..)：代表上一级目标</span></div><div class="line">closedir(用opendir打开的资源)</div><div class="line"><span class="comment">//关闭目录 </span></div><div class="line">rmdir()</div><div class="line"><span class="comment">//删除目录</span></div></pre></td></tr></table></figure>
<h1 id="文件上传与下载"><a href="#文件上传与下载" class="headerlink" title="文件上传与下载"></a>文件上传与下载</h1><h2 id="上传文件时需要注意事项："><a href="#上传文件时需要注意事项：" class="headerlink" title="上传文件时需要注意事项："></a>上传文件时需要注意事项：</h2><ol>
<li><p>在前台表单中 传输方式必须为POST方式<br>在前台form属性里面必须指定表单传输编码格式<code>enctype=’multipart/form-data’;</code></p>
</li>
<li><p>后台接收上传文件时，要使用$_FILES接收。</p>
</li>
<li>phpini配置文件设置<figure class="highlight php"><table><tr><td class="code"><pre><div class="line">file_uploads = On  </div><div class="line"><span class="comment">//允许文件上传 设置值Off  表示关闭文件上传功能；</span></div><div class="line">upload_tmp_dir = <span class="string">"c:/wamp/tmp"</span></div><div class="line"><span class="comment">//指定上传文保存的临时目录</span></div><div class="line">upload_max_filesize = <span class="number">2</span>M</div><div class="line"><span class="comment">//文件上传的最大值</span></div><div class="line">post_max_size = <span class="number">8</span>M </div><div class="line"><span class="comment">//post允许接收的最大值</span></div><div class="line"><span class="comment">//注意：upload_max_filesize不能超过POST_MAX_SIZE的最大值。post_max_size里面包含了upload_max_fileszie;</span></div><div class="line"></div><div class="line">move_uploaded_file(‘原路径’，‘目标路径’);</div><div class="line"><span class="comment">//将上传文件移动到指定的目录</span></div><div class="line"><span class="comment">//返回布尔值</span></div></pre></td></tr></table></figure>
</li>
</ol>
<h1 id="文件压缩"><a href="#文件压缩" class="headerlink" title="文件压缩"></a>文件压缩</h1><figure class="highlight php"><table><tr><td class="code"><pre><div class="line"><span class="comment">// 创建临时文件</span></div><div class="line">$tmp_file = tempnam(sys_get_temp_dir(), <span class="string">'CExport_'</span>) . <span class="string">'.zip'</span>;</div><div class="line"><span class="comment">// 实例化</span></div><div class="line">$zip = <span class="keyword">new</span> ZipArchive();</div><div class="line"><span class="comment">// 判断系统编码（因为Windows的zip编码默认为gb2312）</span></div><div class="line">$use_utf_8 = Utils::get_os() == <span class="string">'Macintosh'</span>;</div><div class="line"><span class="keyword">if</span> ($zip-&gt;open($tmp_file, ZipArchive::CREATE) === <span class="keyword">true</span>) &#123;</div><div class="line">    <span class="keyword">if</span> (!<span class="keyword">isset</span>($zip_title)) &#123;</div><div class="line">        $zip_title = XXX;</div><div class="line">    &#125;</div><div class="line">    <span class="comment">// tmpnam第二个参数为前缀</span></div><div class="line">    $tmp_file_name = tempnam(sys_get_temp_dir(), <span class="string">'pre'</span>);</div><div class="line">    $file_name_in_zip = $contract[<span class="string">'title'</span>] . <span class="string">'.docx'</span>;</div><div class="line">    </div><div class="line">    $data = XXX;</div><div class="line">    <span class="comment">// 转换字符编码</span></div><div class="line">    <span class="keyword">if</span> (!$use_utf_8) &#123;</div><div class="line">        <span class="comment">// 转换编码</span></div><div class="line">        $file_name_in_zip = iconv(<span class="string">'utf-8'</span>, <span class="string">'gb2312//IGNORE'</span>, $file_name_in_zip);</div><div class="line">    &#125;</div><div class="line">    <span class="keyword">if</span> (!file_put_contents($tmp_file_name, $data)) &#123;</div><div class="line">        <span class="keyword">return</span> [<span class="string">'success'</span>=&gt;<span class="keyword">false</span>,<span class="string">'error'</span>=&gt;<span class="string">'写入临时文件失败'</span>];</div><div class="line">    &#125;</div><div class="line">    <span class="comment">// addFile参数一：要添加的文件，参数二：压缩文件名</span></div><div class="line">    <span class="comment">// 如果想在zip中创建文件夹, 则第二个参数拼装一下即可</span></div><div class="line">    <span class="comment">// 例:$dir_name . "/" . $file_name_in_zip</span></div><div class="line">    <span class="comment">// $dir_name需要判断字符编码</span></div><div class="line">    <span class="keyword">if</span> (!$zip-&gt;addFile($tmp_file_name, $file_name_in_zip)) &#123;</div><div class="line">        <span class="keyword">return</span> [<span class="string">'success'</span>=&gt;<span class="keyword">false</span>,<span class="string">'error'</span>=&gt;<span class="string">'添加失败'</span>];</div><div class="line">    &#125;</div><div class="line">&#125; <span class="keyword">else</span> &#123;</div><div class="line">    <span class="keyword">return</span> [<span class="string">'success'</span>=&gt;<span class="keyword">false</span>,<span class="string">'error'</span>=&gt;<span class="string">'zip open faild'</span>];</div><div class="line">&#125;</div><div class="line">$zip-&gt;close();</div></pre></td></tr></table></figure>
<h1 id="临时文件"><a href="#临时文件" class="headerlink" title="临时文件"></a>临时文件</h1><figure class="highlight php"><table><tr><td class="code"><pre><div class="line"><span class="comment">// 参数1：目录，参数2：前缀</span></div><div class="line">tempnam(<span class="string">'/tmp/'</span>, <span class="string">'EmailAttachment_'</span>);</div></pre></td></tr></table></figure>
<h1 id="文件的包含"><a href="#文件的包含" class="headerlink" title="文件的包含"></a>文件的包含</h1><h2 id="include"><a href="#include" class="headerlink" title="include"></a>include</h2><blockquote>
<p>作用：相当于将文件的内容复制到指定的文件当中<br>常用于包含函数库或者配置文件等。任何的文件都可以包含。<br>格式：<br><code>include(&#39;路径&#39;);</code>函数<br><code>include ‘路径’;</code>指令<br><code>include_once</code> 单次文件包含<br>作用：相当于将文件的内容复制到指定的文件中。但是如果文件已经包含过，将不在包含，返回true.<br>格式：<br><code>include_once(‘路径’);</code>函数<br><code>include_once ‘路径’;</code>指令</p>
</blockquote>
<p>include和include_once的区别</p>
<blockquote>
<p>include包含文件可以多次，而include_once只能包含一次<br>include效率高于include_once，因为include_once每次都要判断<br>include 包含文件成功，返回数值整型，但是include_once第一次包含返回1，以后返回的true</p>
</blockquote>
<h2 id="require"><a href="#require" class="headerlink" title="require"></a>require</h2><blockquote>
<p>作用：将一个文件请求到另一个文件中。<br>格式：<br><code>require(‘路径’);</code>函数<br><code>require ‘路径’;</code>指令</p>
</blockquote>
<p>Include和require的区别：</p>
<blockquote>
<p>Include包含文件如果失败，提示warming级别错误<br>后续代码继续执行。<br>require包含文件如果失败，提示error级的错误。后续代码将不再执行。</p>
</blockquote>
<p>Require_once</p>
<blockquote>
<p>作用：相当于用require方式，仅包含一次文件，功能类似include_once，都是包含一次<br>格式：<br><code>require_once(‘路径’);</code>函数<br><code>require_once ‘路径’;</code>指令</p>
</blockquote>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <footer class="post-footer">
      

      
        
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/php/数组/" rel="next" title="数组">
                <i class="fa fa-chevron-left"></i> 数组
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/php/正则/" rel="prev" title="">
                 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div id="cloud-tie-wrapper" class="cloud-tie-wrapper"></div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="https://sfault-avatar.b0.upaiyun.com/416/326/4163260007-58a1621e63a68_huge256"
               alt="chimps" />
          <p class="site-author-name" itemprop="name">chimps</p>
           
              <p class="site-description motion-element" itemprop="description"></p>
          
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/archives">
                <span class="site-state-item-count">59</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-categories">
              <a href="/categories/index.html">
                <span class="site-state-item-count">12</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">19</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
        </div>

        
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#学习文件系统相关函数。"><span class="nav-number">1.</span> <span class="nav-text">学习文件系统相关函数。</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#文件的打开和关闭。"><span class="nav-number">2.</span> <span class="nav-text">文件的打开和关闭。</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#目录操作"><span class="nav-number">3.</span> <span class="nav-text">目录操作</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#文件上传与下载"><span class="nav-number">4.</span> <span class="nav-text">文件上传与下载</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#上传文件时需要注意事项："><span class="nav-number">4.1.</span> <span class="nav-text">上传文件时需要注意事项：</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#文件压缩"><span class="nav-number">5.</span> <span class="nav-text">文件压缩</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#临时文件"><span class="nav-number">6.</span> <span class="nav-text">临时文件</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#文件的包含"><span class="nav-number">7.</span> <span class="nav-text">文件的包含</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#include"><span class="nav-number">7.1.</span> <span class="nav-text">include</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#require"><span class="nav-number">7.2.</span> <span class="nav-text">require</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">chimps</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Mist
  </a>
</div>


        

        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  








  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.0"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.0"></script>



  


  




	





  
    
    <script>
      var cloudTieConfig = {
        url: document.location.href, 
        sourceId: "",
        productKey: "48bb30d8783d4b38ba0c95e0283238ca",
        target: "cloud-tie-wrapper"
      };
    </script>
    <script src="https://img1.ws.126.net/f2e/tie/yun/sdk/loader.js"></script>
  










  





  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  

  

  

</body>
</html>
